package org.yenn.pattern.aliyun.structural.adapter;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * 步骤 5
 * 使用 AudioPlayer 来播放不同类型的音频格式。
 */
public class AdapterPatternDemo {
    /**
     * 步骤 6
     * 验证输出。
     *
     * Playing mp3 file. Name: beyond the horizon.mp3
     * Playing mp4 file. Name: alone.mp4
     * Playing vlc file. Name: far far away.vlc
     * Invalid media. avi format not supported
     */
    @Test
    public void play() {
        AudioPlayer audioPlayer = new AudioPlayer();

        audioPlayer.play("mp3", "beyond the horizon.mp3");
        audioPlayer.play("mp4", "alone.mp4");
        audioPlayer.play("vlc", "far far away.vlc");
        audioPlayer.play("avi", "mind me.avi");
    }
}